#include <stdio.h>

#define LEN 5

int main(int argc, char *argv[]) {

    int i, length;

    int exist[LEN] = { 0 };
    int result[LEN] = { 0 };

    scanf("%d", &length);

    for (i = 0; i < length; i++) {
        int number;
        scanf("%d", &number);

        switch (number % 5) {
            case 0:
                if (number % 2 == 0) exist[0]++;
                result[0] += (number % 2 == 0 ? number : 0);
                break;
            case 1:
                exist[1]++;
                result[1] += number * (exist[1] % 2 ? 1 : -1);
                break;
            case 2:
                exist[2]++;
                result[2]++;
                break;
            case 3:
                exist[3]++;
                result[3] += number;
                break;
            case 4:
                exist[4] = 1;
                result[4] = number > result[4] ? number : result[4];
                break;
        }
    }

    for (i = 0; i < LEN; i++) {
        if (exist[i]) {
            if (i == 3) {
                printf("%.1f", (double) result[3] / exist[3]);
            } else {
                printf("%d", result[i]);
            }
        } else {
            printf("N");
        }
        printf("%s", i == LEN - 1 ? "" : " ");
    }

    return 0;
}
